import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types } from 'mongoose';
export type CommentDocument = Comment & Document;

@Schema()
export class Comment {
    @Prop({ required: true,type:Types.ObjectId,ref:'User' })
    user: Types.ObjectId;

    @Prop({ required: true,type:Types.ObjectId,ref:'Video' })
    video: Types.ObjectId;

    @Prop({ required: true })
    content: string;

    @Prop({default: new Date()})
    createtime:Date

    @Prop({default: new Date()})
    updatetime:Date
}

export const CommentSchema = SchemaFactory.createForClass(Comment);